将 Ngrok Conf Editor 加入自启动项

Centos 7:

1
vi /usr/lib/systemd/system/ngrokConfEditor.service

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=ngrok conf editor
Documentation=https://github.com/jshensh/ngrokConfEditor
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/node-v4.4.2-linux-armv7l/bin/forever start /ngrokConfEditor/app.js
ExecStop=/usr/local/node-v4.4.2-linux-armv7l/bin/forever stop /ngrokConfEditor/app.js
PrivateTmp=true

[Install]
WantedBy=multi-user.target
1
2
systemctl enable ngrokConfEditor.service
systemctl reboot

Raspbian:

1
vi /etc/init.d/ngrokconfeditor

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
### BEGIN INIT INFO
# Provides: ngrokconfeditor
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the HTTP Proxy.
### END INIT INFO
case $1 in
start)
/usr/local/node-v4.4.2-linux-armv7l/bin/forever start /ngrokConfEditor/app.js
;;
stop)
/usr/local/node-v4.4.2-linux-armv7l/bin/forever stop /ngrokConfEditor/app.js
;;
*)
echo "Usage: $0 (start|stop)"
;;
esac
1
2
update-rc.d ngrokconfeditor defaults
reboot